
package com.idealighter.game.games.errentexaspoker.handler;

import com.idealighter.game.core.annotation.ResMsgHandler;
import com.idealighter.game.gamehall.dto.SeatInfo;
import com.idealighter.game.games.errentexaspoker.ErrenTexaspokerPlayer;
import com.idealighter.game.games.errentexaspoker.message.ResWinMsg;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.robot.core.Player;
import com.idealighter.game.robot.handler.ResMessageHandler;


@ResMsgHandler(515226)
public class ResWinHandler implements ResMessageHandler {
  @Override
  public void action(Player player, ResMessage message) {
    ResWinMsg msg = (ResWinMsg) message;
    ErrenTexaspokerPlayer texaspokerPlayer = (ErrenTexaspokerPlayer) player;
    SeatInfo seat = texaspokerPlayer.seat(player.playerId);
    if (seat.getOrder() == msg.getOrder()) {
      texaspokerPlayer.domain.setWin(1);
    }
  }
}
